package o;

import android.graphics.Bitmap;
import android.os.Build.VERSION;
import android.text.Html;
import android.widget.RemoteViews;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat.d;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;

public class dat {

    public static class b {
        public static void ˊ(@NonNull d dVar, @NonNull List<Bitmap> list, @NonNull String str) {
            int i = 6;
            ArrayList arrayList = new ArrayList(list);
            if (arrayList.size() > 0) {
                RemoteViews ˏ = ˏ();
                ˏ.setImageViewBitmap(czk$c.ʼ, daq.ˎ(dVar));
                String charSequence = daq.ॱ(dVar).toString();
                try {
                    charSequence = URLDecoder.decode(charSequence, "UTF-8");
                } catch (UnsupportedEncodingException e) {
                }
                ˏ.setTextViewText(czk$c.ˈ, Html.fromHtml(charSequence));
                ˏ.removeAllViews(czk$c.ॱˎ);
                if (!arrayList.isEmpty()) {
                    int size = arrayList.size();
                    if (size <= 6) {
                        i = size;
                    }
                    for (int i2 = 0; i2 < i; i2++) {
                        Bitmap bitmap = (Bitmap) arrayList.get(i2);
                        if (bitmap != null) {
                            RemoteViews remoteViews = new RemoteViews(ContentManager.getInstant().getContext().getPackageName(), czk$e.ᐝ);
                            remoteViews.setImageViewBitmap(czk$c.ʽॱ, bitmap);
                            ˏ.addView(czk$c.ॱˎ, remoteViews);
                        }
                    }
                }
                ˏ.setTextViewText(czk$c.ʼॱ, str);
                dVar.ˎ(ˏ);
            }
        }

        private static RemoteViews ˏ() {
            String packageName = ContentManager.getInstant().getContext().getPackageName();
            if (epv.ˎ()) {
                return new RemoteViews(packageName, czk$e.ॱˊ);
            }
            if (VERSION.SDK_INT >= 23) {
                return new RemoteViews(packageName, czk$e.ˋॱ);
            }
            return new RemoteViews(packageName, czk$e.ͺ);
        }
    }
}
